import request from "../request";
import {getToken} from "../../utils/auth";

export function insertOrUpdateUser(user){
    let url = "/api/user/save";
    return request.post(url,user,{
        headers:{
            'Token':getToken()
        },
    })
}

export function resetPwd(userId){
    let url="/api/user/resetPwd";
    return request.post(url,null,{
        headers:{
            'Token':getToken()
        },
        params:{
            userId
        }
    })
}

export function selectBusinessByCurrentUser(){
    let url = "/api/user/getBusiness";
    return request.get(url,{
        headers:{
            Token:getToken()
        }
    })
}

export function updatePassword(newPassword){
    let url = "/api/user/updatePassword";
    return request.post(url,null,{
        headers:{
            Token:getToken()
        },
        params:{
            newPassword
        }
    })
}